<?
include('./header.inc');
include('./database.inc');
if (!isset($_GET['sid']) || !isset($_GET['image'])){
	header( 'Location: ./slides.php' ) ;
	die();
}
$sid = mysql_real_escape_string($_GET['sid']);
$image = $_GET['image'];
$query1 = "SELECT * FROM slides WHERE slide_id='$sid'";

$result1 = mysql_query($query1);

$row = mysql_fetch_array( $result1 );

include('./pagehead.inc');
?>
<h2>Change <? echo $row['slide_name']?> <? echo $image ?> Image </h2>
<form name="createslides" action="./updateimage.php" method="post" enctype="multipart/form-data">
<table>
	<tr><td class="label">Current Image:</td><td><img src="../images/<?echo $row['folder'].'/'.$row[$image.'file']; ?>" width="360" /></td></tr>
	<tr><td class="label">New Image:</td><td><input type="file" name="file" /></td></tr>
	<tr><td></td><td><input type="submit" name="submit" value="Save" class="button"/></td>
</table>
<input type="hidden" name="submitted" value="submitted" />
<input type="hidden" name="sid" value="<? echo $sid; ?>" />
<input type="hidden" name="image" value="<? echo $image ?>" />
</form>
<?
include('./pagefoot.inc');
?>